package com.kpmg.datalake.schedule.service;

import com.kpmg.datalake.schedule.model.ScheduleJob;
import java.util.List;
import org.quartz.SchedulerException;

/**
 * @author Alex.zhao [alex.zhao@kpmg.com]
 * @since Created on azhao6 on 2018-08-09 21:33:51
 * 任务管理
 */
public interface IScheduleMangerService {
    /**
     * 往 SchedulerFactoryBean quartz中添加任务
     *
     * @param job 任务
     * @throws SchedulerException SchedulerException
     */
    void addJob(ScheduleJob job) throws SchedulerException;

    List<ScheduleJob> getAllJob() throws SchedulerException;

    List<ScheduleJob> getRunningJob() throws SchedulerException;

    void pauseJob(ScheduleJob scheduleJob) throws SchedulerException;

    void resumeJob(ScheduleJob scheduleJob) throws SchedulerException;

    void deleteJob(ScheduleJob scheduleJob) throws SchedulerException;

    void runAJobNow(ScheduleJob scheduleJob) throws SchedulerException;

    void updateJobCron(ScheduleJob scheduleJob) throws SchedulerException;

  /**
   * 验证bean是否合法
   *
   * @param instanceName instanceName
   * @return Boolean
   */
  Boolean validateBeanOrClass(String instanceName);
}
